package JBCD;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;

public class MetodoConexao {

	static String url = "jdbc:postgresql://localhost:5432/postgres";
	static  String usuario = "postgres";
	static   String senha = "root";      
	public static   Statement coneck;      
   public static Connection con;
    
   public static void conctarBanco(){
	try {
		con = DriverManager.getConnection(url, usuario, senha);
		coneck = con.createStatement();
		
	}catch (SQLException e) {
		System.out.println("erro ao conectar");
        e.printStackTrace();
        throw new java.lang.RuntimeException("erro ao fechar");
	}
   }

}
